<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.org/ui">

<ui:composition template="#{pageContext.servletContext.contextPath}/templates/template.xhtml">
	<ui:define name="title">
		<h:outputText value="#{msg.tcc_bi_consulta_historico}" />
	</ui:define>
	<ui:define name="context">
		<h:form>
			<h></h>
			
			<h:panelGrid cellpadding="0" cellspacing="0" columns="4" style="width:100%" >
				<h:outputLabel  value="#{msg.tcc_bi_consulta_historico_origem}" for="origem" >:</h:outputLabel>
				<p:inputText id="origem" value="#{precoBean.entity.origem.dsOrigem}" style="width:90%"></p:inputText>
				
				<h:outputLabel value="#{msg.tcc_bi_consulta_historico_produto}" for="produto" >:</h:outputLabel> 
				<p:inputText id="produto" value="#{precoBean.entity.produto.dsProduto}" style="width:90%"></p:inputText>
				
				<h:outputLabel value="#{msg.tcc_bi_consulta_historico_marca}" for="marca" >:</h:outputLabel>
				<p:inputText id="marca" value="#{precoBean.entity.produto.dsMarca}" style="width:90%"></p:inputText>
					
				<h:outputLabel value="#{msg.tcc_bi_consulta_historico_dia}" for="dia" >:</h:outputLabel>
				<h:selectOneMenu id="dia" value="#{precoBean.entity.tempo.dia}" style="width: 95%" >
					<f:selectItem itemLabel="#{msg.selectonemenu_selecione}" itemValue="" />
					<f:selectItems value="#{precoBean.filtroDTO.nuDias}" var="nuDia" itemLabel="#{nuDia}" itemValue="#{nuDia}" />
				</h:selectOneMenu>
				
				<h:outputLabel value="#{msg.tcc_bi_consulta_historico_mes}" for="mes">:</h:outputLabel>
				<h:selectOneMenu id="mes" value="#{precoBean.entity.tempo.mes}" style="width: 95%" >
					<f:selectItem itemLabel="#{msg.selectonemenu_selecione}" itemValue="" />
					<f:selectItems value="#{precoBean.filtroDTO.dsMeses}" var="nuMes" itemLabel="#{nuMes}" itemValue="#{nuMes}" />
				</h:selectOneMenu>
				
				<h:outputLabel value="#{msg.tcc_bi_consulta_historico_ano}" for="ano">:</h:outputLabel>
				<h:selectOneMenu id="ano" value="#{precoBean.entity.tempo.ano}" style="width: 95%" >
					<f:selectItem itemLabel="#{msg.selectonemenu_selecione}" itemValue="" />
					<f:selectItems value="#{precoBean.filtroDTO.nuAnos}" var="nuAno" itemLabel="#{nuAno}" itemValue="#{nuAno}" />
				</h:selectOneMenu>
				
				<h:outputLabel value="#{msg.tcc_bi_consulta_historico_dia_semana}" for="diasemana">:</h:outputLabel>
				<h:selectOneMenu id="diasemana" value="#{precoBean.entity.tempo.diaSemana}" style="width: 95%" >
					<f:selectItem itemLabel="#{msg.selectonemenu_selecione}" itemValue="" />
					<f:selectItems  value="#{precoBean.filtroDTO.dsDiasdasemana}" var="dsDiasemana" itemLabel="#{dsDiasemana}" itemValue="#{dsDiasemana}" />
				</h:selectOneMenu>	
						
				<h:outputLabel  value="#{msg.tcc_bi_consulta_historico_preco}" for="preco" >:</h:outputLabel>
				<p:inputMask id="preco" value="#{precoBean.entity.vlPreco}" style="width:90%" ></p:inputMask>	
				
				<h:outputLabel value="#{msg.tcc_bi_consulta_historico_campos_ordenacao}" for="camposOrdenacao">:</h:outputLabel>
				<h:selectOneMenu id="camposOrdenacao" value="#{precoBean.entity.atributoOrdenacao}" style="width: 95%" >
					<f:selectItem itemLabel="#{msg.selectonemenu_selecione}" itemValue="" />
					<f:selectItems  value="#{precoBean.filtroDTO.camposOrdenacao}" var="camposOrdenacao" itemLabel="#{camposOrdenacao}" itemValue="#{camposOrdenacao}" />
				</h:selectOneMenu>
				
				<h:outputLabel value="#{msg.tcc_bi_consulta_historico_tipos_ordenacao}" for="tiposOrdenacao">:</h:outputLabel>
				<h:selectOneMenu id="tiposOrdenacao" value="#{precoBean.entity.tipoOrdenacao}" style="width: 95%" >
					<f:selectItem itemLabel="#{msg.selectonemenu_selecione}" itemValue="" />
					<f:selectItems  value="#{precoBean.filtroDTO.tiposOrdenacao}" var="tiposOrdenacao" itemLabel="#{tiposOrdenacao}" itemValue="#{tiposOrdenacao}" />
				</h:selectOneMenu>
				
				
			</h:panelGrid>
			
			<h:panelGrid cellpadding="0" cellspacing="0" columns="1"  style="width:100%">
				
				<p:commandButton value="#{msg.button_consultar}"  action="#{precoBean.consultarDW}" ajax="false" />
			</h:panelGrid>
			<h></h>
			
			<p:dataTable id="precos" var="row"   value="#{precoBean.rows}" paginatorAlwaysVisible="false" 
			    emptyMessage="#{msg.warning_nenhum_registro_encontrado}" paginatorPosition="bottom"
				paginator="true" rows="6" style="width:101%">
				
				<f:facet name="header">
					#{msg.tcc_bi_consulta_historico}
				</f:facet>
				
				<p:column headerText="#{msg.tcc_bi_consulta_historico_origem}" filterStyle="width:100%"
					filterBy="#{row.origem.dsOrigem}" filterMatchMode="contains" style="width:30px">
					<h:outputText value="#{row.origem.dsOrigem}" />
				</p:column>
				
				<p:column headerText="#{msg.tcc_bi_consulta_historico_marca}" filterStyle="width:100%"
					filterBy="#{row.produto.dsMarca}" filterMatchMode="contains" style="width:30px">
					<h:outputText value="#{row.produto.dsMarca}" />
				</p:column>
			
				<p:column headerText="#{msg.tcc_bi_consulta_historico_produto}"  filterStyle="width:100%"
					filterBy="#{row.produto.dsProduto}" filterMatchMode="contains">
					<h:outputText value="#{row.produto.dsProduto}" />
				</p:column>
				
				<p:column headerText="#{msg.tcc_bi_consulta_historico_preco}"  filterStyle="width:100%"
					filterBy="#{row.vlPreco}" filterMatchMode="exact" style="width:6px">
					<h:outputFormat  value="#{row.vlPreco}"  />
				</p:column>
						
				<p:column headerText="#{msg.tcc_bi_consulta_historico_dia_semana}"  filterStyle="width:100% "
					filterBy="#{row.tempo.diaSemana}" filterMatchMode="contains" style="width:15px">
					<h:outputFormat  value="#{row.tempo.diaSemana}"  />
				</p:column>
						
				<p:column headerText="#{msg.tcc_bi_consulta_historico_dia}"  filterStyle="width:100%"
					filterBy="#{row.tempo.dia}" filterMatchMode="exact" style="width:8px">
					<h:outputFormat  value="#{row.tempo.dia}"  />
				</p:column>
				
				<p:column headerText="#{msg.tcc_bi_consulta_historico_mes}"  filterStyle="width:100% "
					filterBy="#{row.tempo.mes}" filterMatchMode="contains" style="width:10px">
					<h:outputFormat  value="#{row.tempo.mes}"  />
				</p:column>
				
				<p:column headerText="#{msg.tcc_bi_consulta_historico_ano}"  filterStyle="width:100% "
					filterBy="#{row.tempo.ano}" filterMatchMode="exact" style="width:10px" >
					<h:outputFormat  value="#{row.tempo.ano}"  />
				</p:column>
				<!-- 
				
				 -->
			</p:dataTable>
			<p:messages showDetail="true" showSummary="false" />
		</h:form>
	
	</ui:define>
</ui:composition>
</html>